/*
    Submodule interface class
    Interface between submodule code and loader code, and to other obse plugins if desired
*/
#pragma once

class   TESObjectREFR;      // COEF/API/TESForms/TESObjectREFR.h
class   TESForm;            // COEF/API/TESForms/TESForm.h
class	BSStringT;			// COEF/API/BSTypes/BSStringT.h

#define DECLARE_INTFC_GET(type, cmnd, retn) \
	virtual retn					Get ## type ## cmnd ## (TESForm* form)

#define DECLARE_INTFC_SET(type, cmnd, vtype) \
	virtual bool					Set ## type ## cmnd ## (TESForm* form, vtype val)

#define DECLARE_INTFC_PAIR(type, cmnd, retval) \
	DECLARE_INTFC_GET(type, cmnd, retval);\
	DECLARE_INTFC_SET(type, cmnd, retval)

#define DECLARE_INTFC_GET_NTH(type, cmnd, retn) \
	virtual retn					Get ## type ## Nth ## cmnd ## (TESForm* form, UInt32 n)

#define DECLARE_INTFC_SET_NTH(type, cmnd, vtype) \
	virtual bool					Set ## type ## Nth ## cmnd ## (TESForm* form, UInt32 n, vtype val)

#define DECLARE_INTFC_PAIR_NTH(type, cmnd, retval) \
	DECLARE_INTFC_GET_NTH(type, cmnd, retval);\
	DECLARE_INTFC_SET_NTH(type, cmnd, retval)

class SubmoduleInterface
{
public:
    // commands
    virtual /*00*/ void             ListMyForms();
	DECLARE_INTFC_PAIR	(MagicItemGenerator,IsSuffix,		bool		);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,MinUses,		UInt16		);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,MaxUses,		UInt16		);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,Rank,			SInt16		);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,Frequency,		UInt8		);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,IsAutocalc,		bool		);
	DECLARE_INTFC_GET	(MagicItemGenerator,AffixMask,		UInt8		);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixSubpetty,	const char*	);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixPetty,		const char*	);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixLesser,	const char*	);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixCommon,	const char*	);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixGreater,	const char*	);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixGrand,		const char*	);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixUltragrand,const char*	);
	DECLARE_INTFC_PAIR	(MagicItemGenerator,AffixNegative,	const char*	);
	
	DECLARE_INTFC_GET	(AffixFilter,		NumAffixes,		UInt32		);
	virtual bool AffixFilterAddAffix(TESForm* form, TESForm* mig_form, UInt8 soul);
	virtual bool AffixFilterDeleteNthAffix(TESForm* form, UInt32 n);

	DECLARE_INTFC_GET_NTH(	AffixFilter,	AffixMagicItemGenerator,UInt32);
	DECLARE_INTFC_SET_NTH(	AffixFilter,	AffixMagicItemGenerator,TESForm*);
	DECLARE_INTFC_PAIR_NTH(	AffixFilter,	AffixMask,		UInt8		);


	DECLARE_INTFC_PAIR	(AffixFilter,		NameFilter,		const char*	);
	DECLARE_INTFC_PAIR	(AffixFilter,		MinValue,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MaxValue,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MinWeight,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MaxWeight,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MinDurability,	double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MaxDurability,	double		);

	DECLARE_INTFC_PAIR	(AffixFilter,		ApparelMask,	UInt8		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MinArmorRating,	double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MaxArmorRating,	double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		HidesRings,		int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		HidesAmulet,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedHead,		int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedHair,		int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedBodyLower,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedBodyUpper,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedHand,		int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedFoot,		int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedRingLeft,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedRingRight,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedAmulet,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedWeapon,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedWeaponBack,int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedWeaponSide,int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedQuiver,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedShield,	int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedTorch,		int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		BipedTail,		int			);
	DECLARE_INTFC_PAIR	(AffixFilter,		ModelFilterBipedMale,	const char*	);
	DECLARE_INTFC_PAIR	(AffixFilter,		ModelFilterBipedFemale,	const char*	);
	DECLARE_INTFC_PAIR	(AffixFilter,		ModelFilterGroundMale,	const char*	);
	DECLARE_INTFC_PAIR	(AffixFilter,		ModelFilterGroundFemale,const char*	);
	DECLARE_INTFC_PAIR	(AffixFilter,		IconFilterMale,			const char*	);
	DECLARE_INTFC_PAIR	(AffixFilter,		IconFilterFemale,		const char*	);
	
	DECLARE_INTFC_PAIR	(AffixFilter,		WeaponMask,		UInt8		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MinDamage,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MaxDamage,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MinReach,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MaxReach,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MinSpeed,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		MaxSpeed,		double		);
	DECLARE_INTFC_PAIR	(AffixFilter,		IgnoresNormalWeaponResistance,	int	);
	DECLARE_INTFC_PAIR	(AffixFilter,		ModelFilterWeapon,		const char*	);
	DECLARE_INTFC_PAIR	(AffixFilter,		IconFilterWeapon,		const char*	);

	virtual std::vector< std::pair<UInt32, UInt32> >* GeneratedItemList() const;

	virtual TESForm*					Enchant(TESForm* form, UInt16 level, bool LtEq = true) const;

	// internals
    virtual /*0C*/ const char*		    Description();  // prints & returns a short description of this plugin
};
